<template>
	<view class="home">
		<view class="active-body">
			<view class="active-body-item" v-for="v in notice" :key="v.id">
				<view class="item-boxOne">
					<view class="item-box"> </view>
					<view class="item-text">
						<view class="top">
							<text>{{v.propertyName}}</text>
						</view>
						<view class="bottom">
							<text>{{v.floor}}</text>
						</view>
					</view>
					<view class="item-boxTwo">
						<view class="text">
							<view class="divLine"></view>
							<text class="item-txt">值班电话</text>
							<text>{{v.propertyPhoneOne}}</text>
							<view class="icont" @click="toggleshow">
								<view class="iconfont icon-dianhua"></view>
							</view>
						</view>
						<view class="text">
							<view class="divLine"></view>
							<text class="item-txt">值班电话</text>
							<text>{{v.propertyPhoneTwo}}</text>
							<view class="icont" @click="toggleshow">
								<view class="iconfont icon-dianhua"></view>
							</view>
						</view>
					</view>
				</view>
			</view>
			<button class="button">在线客服</button>
		</view>
	</view>
</template>

<script>
	import {
		http
	} from "../../utils/http.js"
	export default {
		data() {
			return {
				notice: [],
				title: "",
			};
		},
		methods: {
			toggleshow() {
				uni.makePhoneCall({
					phoneNumber: '021-5889090' //仅为示例
				});
			},

			getData() {
				http({
					url: "/property/list",
					method: "get",
				}).then((res) => {
					// console.log(res)
					if (res.code == 0) {
						this.notice = res.data;
					} else {
						console.log("数据接收失败")
					}

				})
			}

		},
		onLoad() {
			this.getData();
		},
	}
</script>

<style lang="less">
	@import url('../../static/font/iconfont.css');

	.home {
		padding: 40rpx;
		display: flex;
		flex-direction: column;

		.divLine {
			background: #E0E3DA;
			width: 100%;
			height: 3rpx;
		}

		.icont {
			margin-top: -50rpx;
			margin-left: 400rpx;
			// border: 1px solid red;
		}

		.active-body {
			height: 100%;

			.button {
				margin-top: 40rpx;
				margin-left: 20rpx;
				margin-right: 20rpx;
				border-radius: 5px;
				background-color: blue;
				color: white;
			}

			.active-body-item {
				border: 1px solid #e1e1e1;
				border-radius: 8px;
				height: 315rpx;
				margin: 20rpx 0;
				display: flex;
				justify-content: space-evenly;
				// align-items: center;
				box-shadow: 0px 0px 15rpx rgba(0, 0, 0, .2);

				.item-boxOne {
					// border: 1rpx solid red;
					height: 200rpx;
					width: 700rpx;
					margin-top: 20rpx;

					.item-box {
						width: 162rpx;
						height: 162rpx;
						background-color: #e6f1ff;
						border-radius: 8px;
						margin: 0 10px;
						// border: 1rpx solid red;
					}

					.item-text {
						// border: 1rpx solid red;
						flex: 1;
						height: 100rpx;
						width: 420rpx;
						margin-left: 220rpx;
						margin-top: -130rpx;

						.top {
							margin-bottom: 8px;

						}

						.bottom {
							// border: 1rpx solid red;
							font-size: 24rpx;
							color: #b8b8b8;
						}
					}
				}

				.item-boxTwo {
					width: 580rpx;
					height: 50rpx;
					line-height: 50rpx;
					margin-top: 50rpx;
					margin-left: 20rpx;
					font-size: 28rpx;

					// border: 1rpx solid red;
					.item-txt {
						color: #b8b8b8;
					}

					text {
						margin: 20rpx;
					}
				}

			}
		}
	}
</style>
